
using System;
using System.Collections.Generic;
using System.IO;

namespace Chronicle.Analyzation
{
	public class Actor
	{
		public string Name { get; set;  }
		public string Id { get; set;  }
		public ActorType ActorType { get; set; }
		public Actor(string id, string name)
		{
			this.Id = id;
			this.Name = name;
		}
		public DateTime FirstAction { get; set; }
		public DateTime LastAction { get; set; }

		Dictionary<string, object> tagData = new Dictionary<string, object>();

		public T GetTagData<T> (Func<T> createNew) where T : class
		{
			object result;
			string name = typeof(T).ToString ();
			if (!tagData.TryGetValue(name, out result)) {
				T newTagData = createNew();
				tagData[name] = newTagData;
				return newTagData;
			}
			return (T) result;
		}
	}
}
